package com.mqb.session;

import com.alibaba.fastjson.JSONObject;
import io.netty.channel.Channel;
import org.apache.commons.lang3.tuple.MutableTriple;
import org.apache.commons.lang3.tuple.Triple;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
 * 模拟
 * 用户不在线时，未发送的数据临时存放
 */
public class Temp {

    private static final List<Triple<String, Channel, JSONObject>> tempMsgs = Collections.synchronizedList(new LinkedList<>());


    public static List<Triple<String, Channel, JSONObject>> getTempMsgs() {
        return tempMsgs;
    }

    public static boolean add(Triple<String, Channel, JSONObject> triple) {
        return tempMsgs.add(triple);
    }

    public static boolean remove(Triple<String, Channel, JSONObject> triple) {
        return tempMsgs.remove(triple);
    }
}
